<?php
/**
 * Created by PhpStorm.
 * User: cephei
 * Date: 11/24/15
 * Time: 2:47 PM
 */
use Core\PluginContainer;

define("ROOT_PATH",__DIR__.'/..');
require_once "AutoLoad.php";

$container = new PluginContainer();
$modulesText = file_get_contents(ROOT_PATH."/Configs/Modules.json");
$modules = json_decode($modulesText);
$providers=[];
foreach($modules as $module){
    if($module->enable<=0)
        continue;
    $provider = new $module->class();
    if(!empty($provider)&&method_exists($provider,'register')) {
        $provider->register();
        $providers[] = $provider;
    }
}

foreach($providers as $provider){
    if(method_exists($provider,'autoBoot')){
        $provider->autoBoot();
    }
}